import React from "react";
import "./index.scss";
import EditorRt from "./EditorRt";
import ArticleHeader from "./ArticleHeader";
import DrawerMultilayer from "./DrawerMultilayer";
import { message } from "antd";
export default function ArticleCom({
  editorRtValue,
  editorChange,
  editorStyle,
  headerValue,
  handlerId,
  OssFileVisible,
  SettingVisible,
  openSettingVisible,
  closeSettingVisible,
  openOssFileVisible,
  closeOssFileVisible,
  handlerDataInfo,
  handlerPublicBtn,
  handlerDraftsBtn,
  isExecuteHandlerDelClick,
  isDisableDelBtn = false, //删除按钮禁用状态
  isDisableCheckBtn = false, //查看按钮禁用状态
  titleText = "文章设置",
  messageFn = () => {
    message.warning("默认提示");
  },
  ...props
}) {
  return (
    <>
      <ArticleHeader
        headerValue={headerValue}
        handlerId={handlerId}
        openSettingVisible={openSettingVisible}
        handlerDataInfo={handlerDataInfo}
        handlerPublicBtn={handlerPublicBtn}
        handlerDraftsBtn={handlerDraftsBtn}
        isExecuteHandlerDelClick={isExecuteHandlerDelClick}
        isDisableDelBtn={isDisableDelBtn}
        isDisableCheckBtn={isDisableCheckBtn}
        messageFn={messageFn}
      ></ArticleHeader>
      <EditorRt value={editorRtValue} onchange={editorChange} style={editorStyle}></EditorRt>
      <DrawerMultilayer
        OssFileVisible={OssFileVisible}
        SettingVisible={SettingVisible}
        openSettingVisible={openSettingVisible}
        closeSettingVisible={closeSettingVisible}
        openOssFileVisible={openOssFileVisible}
        closeOssFileVisible={closeOssFileVisible}
        handlerDataInfo={handlerDataInfo}
        titleText={titleText}
      >
        {props.children}
      </DrawerMultilayer>
    </>
  );
}
